// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gax;
extern crate gaxi;
extern crate gkehub_configmanagement_v1;
extern crate gkehub_multiclusteringress_v1;
extern crate lazy_static;
extern crate longrunning;
extern crate lro;
extern crate reqwest;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;

mod debug;
mod deserialize;
mod serialize;

/// Feature represents the settings and status of any Hub Feature.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Feature {
    /// Output only. The full, unique name of this Feature resource in the format
    /// `projects/*/locations/*/features/*`.
    pub name: std::string::String,

    /// GCP labels for this Feature.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Output only. State of the Feature resource itself.
    pub resource_state: std::option::Option<crate::model::FeatureResourceState>,

    /// Optional. Hub-wide Feature configuration. If this Feature does not support any
    /// Hub-wide configuration, this field may be unused.
    pub spec: std::option::Option<crate::model::CommonFeatureSpec>,

    /// Optional. Membership-specific configuration for this Feature. If this Feature does
    /// not support any per-Membership configuration, this field may be unused.
    ///
    /// The keys indicate which Membership the configuration is for, in the form:
    ///
    /// ```norust
    /// projects/{p}/locations/{l}/memberships/{m}
    /// ```
    ///
    /// Where {p} is the project, {l} is a valid location and {m} is a valid
    /// Membership in this project at that location. {p} WILL match the Feature's
    /// project.
    ///
    /// {p} will always be returned as the project number, but the project ID is
    /// also accepted during input. If the same Membership is specified in the map
    /// twice (using the project ID form, and the project number form), exactly
    /// ONE of the entries will be saved, with no guarantees as to which. For this
    /// reason, it is recommended the same format be used for all entries when
    /// mutating a Feature.
    pub membership_specs:
        std::collections::HashMap<std::string::String, crate::model::MembershipFeatureSpec>,

    /// Output only. The Hub-wide Feature state.
    pub state: std::option::Option<crate::model::CommonFeatureState>,

    /// Output only. Membership-specific Feature status. If this Feature does
    /// report any per-Membership status, this field may be unused.
    ///
    /// The keys indicate which Membership the state is for, in the form:
    ///
    /// ```norust
    /// projects/{p}/locations/{l}/memberships/{m}
    /// ```
    ///
    /// Where {p} is the project number, {l} is a valid location and {m} is a valid
    /// Membership in this project at that location. {p} MUST match the Feature's
    /// project number.
    pub membership_states:
        std::collections::HashMap<std::string::String, crate::model::MembershipFeatureState>,

    /// Output only. When the Feature resource was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. When the Feature resource was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Output only. When the Feature resource was deleted.
    pub delete_time: std::option::Option<wkt::Timestamp>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Feature {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Feature::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [labels][crate::model::Feature::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [resource_state][crate::model::Feature::resource_state].
    pub fn set_resource_state<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::FeatureResourceState>,
    {
        self.resource_state = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [resource_state][crate::model::Feature::resource_state].
    pub fn set_or_clear_resource_state<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::FeatureResourceState>,
    {
        self.resource_state = v.map(|x| x.into());
        self
    }

    /// Sets the value of [spec][crate::model::Feature::spec].
    pub fn set_spec<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::CommonFeatureSpec>,
    {
        self.spec = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [spec][crate::model::Feature::spec].
    pub fn set_or_clear_spec<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::CommonFeatureSpec>,
    {
        self.spec = v.map(|x| x.into());
        self
    }

    /// Sets the value of [membership_specs][crate::model::Feature::membership_specs].
    pub fn set_membership_specs<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<crate::model::MembershipFeatureSpec>,
    {
        use std::iter::Iterator;
        self.membership_specs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [state][crate::model::Feature::state].
    pub fn set_state<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::CommonFeatureState>,
    {
        self.state = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [state][crate::model::Feature::state].
    pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::CommonFeatureState>,
    {
        self.state = v.map(|x| x.into());
        self
    }

    /// Sets the value of [membership_states][crate::model::Feature::membership_states].
    pub fn set_membership_states<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<crate::model::MembershipFeatureState>,
    {
        use std::iter::Iterator;
        self.membership_states = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [create_time][crate::model::Feature::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Feature::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Feature::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Feature::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [delete_time][crate::model::Feature::delete_time].
    pub fn set_delete_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.delete_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [delete_time][crate::model::Feature::delete_time].
    pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.delete_time = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for Feature {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.Feature"
    }
}

/// FeatureResourceState describes the state of a Feature *resource* in the
/// GkeHub API. See `FeatureState` for the "running state" of the Feature in the
/// Hub and across Memberships.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FeatureResourceState {
    /// The current state of the Feature resource in the Hub API.
    pub state: crate::model::feature_resource_state::State,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl FeatureResourceState {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [state][crate::model::FeatureResourceState::state].
    pub fn set_state<T: std::convert::Into<crate::model::feature_resource_state::State>>(
        mut self,
        v: T,
    ) -> Self {
        self.state = v.into();
        self
    }
}

impl wkt::message::Message for FeatureResourceState {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.FeatureResourceState"
    }
}

/// Defines additional types related to [FeatureResourceState].
pub mod feature_resource_state {
    #[allow(unused_imports)]
    use super::*;

    /// State describes the lifecycle status of a Feature.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// State is unknown or not set.
        Unspecified,
        /// The Feature is being enabled, and the Feature resource is being created.
        /// Once complete, the corresponding Feature will be enabled in this Hub.
        Enabling,
        /// The Feature is enabled in this Hub, and the Feature resource is fully
        /// available.
        Active,
        /// The Feature is being disabled in this Hub, and the Feature resource
        /// is being deleted.
        Disabling,
        /// The Feature resource is being updated.
        Updating,
        /// The Feature resource is being updated by the Hub Service.
        ServiceUpdating,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Enabling => std::option::Option::Some(1),
                Self::Active => std::option::Option::Some(2),
                Self::Disabling => std::option::Option::Some(3),
                Self::Updating => std::option::Option::Some(4),
                Self::ServiceUpdating => std::option::Option::Some(5),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Enabling => std::option::Option::Some("ENABLING"),
                Self::Active => std::option::Option::Some("ACTIVE"),
                Self::Disabling => std::option::Option::Some("DISABLING"),
                Self::Updating => std::option::Option::Some("UPDATING"),
                Self::ServiceUpdating => std::option::Option::Some("SERVICE_UPDATING"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Enabling,
                2 => Self::Active,
                3 => Self::Disabling,
                4 => Self::Updating,
                5 => Self::ServiceUpdating,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "ENABLING" => Self::Enabling,
                "ACTIVE" => Self::Active,
                "DISABLING" => Self::Disabling,
                "UPDATING" => Self::Updating,
                "SERVICE_UPDATING" => Self::ServiceUpdating,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Enabling => serializer.serialize_i32(1),
                Self::Active => serializer.serialize_i32(2),
                Self::Disabling => serializer.serialize_i32(3),
                Self::Updating => serializer.serialize_i32(4),
                Self::ServiceUpdating => serializer.serialize_i32(5),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.gkehub.v1.FeatureResourceState.State",
            ))
        }
    }
}

/// FeatureState describes the high-level state of a Feature. It may be used to
/// describe a Feature's state at the environ-level, or per-membershop, depending
/// on the context.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FeatureState {
    /// The high-level, machine-readable status of this Feature.
    pub code: crate::model::feature_state::Code,

    /// A human-readable description of the current status.
    pub description: std::string::String,

    /// The time this status and any related Feature-specific details were updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl FeatureState {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [code][crate::model::FeatureState::code].
    pub fn set_code<T: std::convert::Into<crate::model::feature_state::Code>>(
        mut self,
        v: T,
    ) -> Self {
        self.code = v.into();
        self
    }

    /// Sets the value of [description][crate::model::FeatureState::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [update_time][crate::model::FeatureState::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::FeatureState::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for FeatureState {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.FeatureState"
    }
}

/// Defines additional types related to [FeatureState].
pub mod feature_state {
    #[allow(unused_imports)]
    use super::*;

    /// Code represents a machine-readable, high-level status of the Feature.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Code {
        /// Unknown or not set.
        Unspecified,
        /// The Feature is operating normally.
        Ok,
        /// The Feature has encountered an issue, and is operating in a degraded
        /// state. The Feature may need intervention to return to normal operation.
        /// See the description and any associated Feature-specific details for more
        /// information.
        Warning,
        /// The Feature is not operating or is in a severely degraded state.
        /// The Feature may need intervention to return to normal operation.
        /// See the description and any associated Feature-specific details for more
        /// information.
        Error,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [Code::value] or
        /// [Code::name].
        UnknownValue(code::UnknownValue),
    }

    #[doc(hidden)]
    pub mod code {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl Code {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Ok => std::option::Option::Some(1),
                Self::Warning => std::option::Option::Some(2),
                Self::Error => std::option::Option::Some(3),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
                Self::Ok => std::option::Option::Some("OK"),
                Self::Warning => std::option::Option::Some("WARNING"),
                Self::Error => std::option::Option::Some("ERROR"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for Code {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for Code {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for Code {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Ok,
                2 => Self::Warning,
                3 => Self::Error,
                _ => Self::UnknownValue(code::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for Code {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "CODE_UNSPECIFIED" => Self::Unspecified,
                "OK" => Self::Ok,
                "WARNING" => Self::Warning,
                "ERROR" => Self::Error,
                _ => Self::UnknownValue(code::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for Code {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Ok => serializer.serialize_i32(1),
                Self::Warning => serializer.serialize_i32(2),
                Self::Error => serializer.serialize_i32(3),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for Code {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
                ".google.cloud.gkehub.v1.FeatureState.Code",
            ))
        }
    }
}

/// CommonFeatureSpec contains Hub-wide configuration information
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CommonFeatureSpec {
    pub feature_spec: std::option::Option<crate::model::common_feature_spec::FeatureSpec>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CommonFeatureSpec {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [feature_spec][crate::model::CommonFeatureSpec::feature_spec].
    ///
    /// Note that all the setters affecting `feature_spec` are mutually
    /// exclusive.
    pub fn set_feature_spec<
        T: std::convert::Into<std::option::Option<crate::model::common_feature_spec::FeatureSpec>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.feature_spec = v.into();
        self
    }

    /// The value of [feature_spec][crate::model::CommonFeatureSpec::feature_spec]
    /// if it holds a `Multiclusteringress`, `None` if the field is not set or
    /// holds a different branch.
    pub fn multiclusteringress(
        &self,
    ) -> std::option::Option<&std::boxed::Box<gkehub_multiclusteringress_v1::model::FeatureSpec>>
    {
        #[allow(unreachable_patterns)]
        self.feature_spec.as_ref().and_then(|v| match v {
            crate::model::common_feature_spec::FeatureSpec::Multiclusteringress(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [feature_spec][crate::model::CommonFeatureSpec::feature_spec]
    /// to hold a `Multiclusteringress`.
    ///
    /// Note that all the setters affecting `feature_spec` are
    /// mutually exclusive.
    pub fn set_multiclusteringress<
        T: std::convert::Into<std::boxed::Box<gkehub_multiclusteringress_v1::model::FeatureSpec>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.feature_spec = std::option::Option::Some(
            crate::model::common_feature_spec::FeatureSpec::Multiclusteringress(v.into()),
        );
        self
    }
}

impl wkt::message::Message for CommonFeatureSpec {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.CommonFeatureSpec"
    }
}

/// Defines additional types related to [CommonFeatureSpec].
pub mod common_feature_spec {
    #[allow(unused_imports)]
    use super::*;

    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum FeatureSpec {
        /// Multicluster Ingress-specific spec.
        Multiclusteringress(std::boxed::Box<gkehub_multiclusteringress_v1::model::FeatureSpec>),
    }
}

/// CommonFeatureState contains Hub-wide Feature status information.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CommonFeatureState {
    /// Output only. The "running state" of the Feature in this Hub.
    pub state: std::option::Option<crate::model::FeatureState>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CommonFeatureState {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [state][crate::model::CommonFeatureState::state].
    pub fn set_state<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::FeatureState>,
    {
        self.state = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [state][crate::model::CommonFeatureState::state].
    pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::FeatureState>,
    {
        self.state = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CommonFeatureState {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.CommonFeatureState"
    }
}

/// MembershipFeatureSpec contains configuration information for a single
/// Membership.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MembershipFeatureSpec {
    pub feature_spec: std::option::Option<crate::model::membership_feature_spec::FeatureSpec>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl MembershipFeatureSpec {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [feature_spec][crate::model::MembershipFeatureSpec::feature_spec].
    ///
    /// Note that all the setters affecting `feature_spec` are mutually
    /// exclusive.
    pub fn set_feature_spec<
        T: std::convert::Into<std::option::Option<crate::model::membership_feature_spec::FeatureSpec>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.feature_spec = v.into();
        self
    }

    /// The value of [feature_spec][crate::model::MembershipFeatureSpec::feature_spec]
    /// if it holds a `Configmanagement`, `None` if the field is not set or
    /// holds a different branch.
    pub fn configmanagement(
        &self,
    ) -> std::option::Option<&std::boxed::Box<gkehub_configmanagement_v1::model::MembershipSpec>>
    {
        #[allow(unreachable_patterns)]
        self.feature_spec.as_ref().and_then(|v| match v {
            crate::model::membership_feature_spec::FeatureSpec::Configmanagement(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [feature_spec][crate::model::MembershipFeatureSpec::feature_spec]
    /// to hold a `Configmanagement`.
    ///
    /// Note that all the setters affecting `feature_spec` are
    /// mutually exclusive.
    pub fn set_configmanagement<
        T: std::convert::Into<std::boxed::Box<gkehub_configmanagement_v1::model::MembershipSpec>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.feature_spec = std::option::Option::Some(
            crate::model::membership_feature_spec::FeatureSpec::Configmanagement(v.into()),
        );
        self
    }
}

impl wkt::message::Message for MembershipFeatureSpec {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.MembershipFeatureSpec"
    }
}

/// Defines additional types related to [MembershipFeatureSpec].
pub mod membership_feature_spec {
    #[allow(unused_imports)]
    use super::*;

    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum FeatureSpec {
        /// Config Management-specific spec.
        Configmanagement(std::boxed::Box<gkehub_configmanagement_v1::model::MembershipSpec>),
    }
}

/// MembershipFeatureState contains Feature status information for a single
/// Membership.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MembershipFeatureState {
    /// The high-level state of this Feature for a single membership.
    pub state: std::option::Option<crate::model::FeatureState>,

    pub feature_state: std::option::Option<crate::model::membership_feature_state::FeatureState>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl MembershipFeatureState {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [state][crate::model::MembershipFeatureState::state].
    pub fn set_state<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::FeatureState>,
    {
        self.state = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [state][crate::model::MembershipFeatureState::state].
    pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::FeatureState>,
    {
        self.state = v.map(|x| x.into());
        self
    }

    /// Sets the value of [feature_state][crate::model::MembershipFeatureState::feature_state].
    ///
    /// Note that all the setters affecting `feature_state` are mutually
    /// exclusive.
    pub fn set_feature_state<
        T: std::convert::Into<
                std::option::Option<crate::model::membership_feature_state::FeatureState>,
            >,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.feature_state = v.into();
        self
    }

    /// The value of [feature_state][crate::model::MembershipFeatureState::feature_state]
    /// if it holds a `Configmanagement`, `None` if the field is not set or
    /// holds a different branch.
    pub fn configmanagement(
        &self,
    ) -> std::option::Option<&std::boxed::Box<gkehub_configmanagement_v1::model::MembershipState>>
    {
        #[allow(unreachable_patterns)]
        self.feature_state.as_ref().and_then(|v| match v {
            crate::model::membership_feature_state::FeatureState::Configmanagement(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [feature_state][crate::model::MembershipFeatureState::feature_state]
    /// to hold a `Configmanagement`.
    ///
    /// Note that all the setters affecting `feature_state` are
    /// mutually exclusive.
    pub fn set_configmanagement<
        T: std::convert::Into<std::boxed::Box<gkehub_configmanagement_v1::model::MembershipState>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.feature_state = std::option::Option::Some(
            crate::model::membership_feature_state::FeatureState::Configmanagement(v.into()),
        );
        self
    }
}

impl wkt::message::Message for MembershipFeatureState {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.MembershipFeatureState"
    }
}

/// Defines additional types related to [MembershipFeatureState].
pub mod membership_feature_state {
    #[allow(unused_imports)]
    use super::*;

    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum FeatureState {
        /// Config Management-specific state.
        Configmanagement(std::boxed::Box<gkehub_configmanagement_v1::model::MembershipState>),
    }
}

/// Membership contains information about a member cluster.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Membership {
    /// Output only. The full, unique name of this Membership resource in the
    /// format `projects/*/locations/*/memberships/{membership_id}`, set during
    /// creation.
    ///
    /// `membership_id` must be a valid RFC 1123 compliant DNS label:
    ///
    /// 1. At most 63 characters in length
    /// 1. It must consist of lower case alphanumeric characters or `-`
    /// 1. It must start and end with an alphanumeric character
    ///
    /// Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`,
    /// with a maximum length of 63 characters.
    pub name: std::string::String,

    /// Optional. Labels for this membership.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Output only. Description of this membership, limited to 63 characters.
    /// Must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.\ ]*`
    ///
    /// This field is present for legacy purposes.
    pub description: std::string::String,

    /// Output only. State of the Membership resource.
    pub state: std::option::Option<crate::model::MembershipState>,

    /// Output only. When the Membership was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. When the Membership was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Output only. When the Membership was deleted.
    pub delete_time: std::option::Option<wkt::Timestamp>,

    /// Optional. An externally-generated and managed ID for this Membership. This
    /// ID may be modified after creation, but this is not recommended.
    ///
    /// The ID must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.]*`
    ///
    /// If this Membership represents a Kubernetes cluster, this value should be
    /// set to the UID of the `kube-system` namespace object.
    pub external_id: std::string::String,

    /// Output only. For clusters using Connect, the timestamp of the most recent
    /// connection established with Google Cloud. This time is updated every
    /// several minutes, not continuously. For clusters that do not use GKE
    /// Connect, or that have never connected successfully, this field will be
    /// unset.
    pub last_connection_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Google-generated UUID for this resource. This is unique across
    /// all Membership resources. If a Membership resource is deleted and another
    /// resource with the same name is created, it gets a different unique_id.
    pub unique_id: std::string::String,

    /// Optional. How to identify workloads from this Membership.
    /// See the documentation on Workload Identity for more details:
    /// <https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity>
    pub authority: std::option::Option<crate::model::Authority>,

    /// Optional. The monitoring config information for this membership.
    pub monitoring_config: std::option::Option<crate::model::MonitoringConfig>,

    /// Type of resource represented by this Membership
    pub r#type: std::option::Option<crate::model::membership::Type>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Membership {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Membership::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [labels][crate::model::Membership::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [description][crate::model::Membership::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [state][crate::model::Membership::state].
    pub fn set_state<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::MembershipState>,
    {
        self.state = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [state][crate::model::Membership::state].
    pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::MembershipState>,
    {
        self.state = v.map(|x| x.into());
        self
    }

    /// Sets the value of [create_time][crate::model::Membership::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Membership::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Membership::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Membership::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [delete_time][crate::model::Membership::delete_time].
    pub fn set_delete_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.delete_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [delete_time][crate::model::Membership::delete_time].
    pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.delete_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [external_id][crate::model::Membership::external_id].
    pub fn set_external_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.external_id = v.into();
        self
    }

    /// Sets the value of [last_connection_time][crate::model::Membership::last_connection_time].
    pub fn set_last_connection_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.last_connection_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [last_connection_time][crate::model::Membership::last_connection_time].
    pub fn set_or_clear_last_connection_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.last_connection_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [unique_id][crate::model::Membership::unique_id].
    pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.unique_id = v.into();
        self
    }

    /// Sets the value of [authority][crate::model::Membership::authority].
    pub fn set_authority<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Authority>,
    {
        self.authority = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [authority][crate::model::Membership::authority].
    pub fn set_or_clear_authority<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Authority>,
    {
        self.authority = v.map(|x| x.into());
        self
    }

    /// Sets the value of [monitoring_config][crate::model::Membership::monitoring_config].
    pub fn set_monitoring_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::MonitoringConfig>,
    {
        self.monitoring_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [monitoring_config][crate::model::Membership::monitoring_config].
    pub fn set_or_clear_monitoring_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::MonitoringConfig>,
    {
        self.monitoring_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [r#type][crate::model::Membership::type].
    ///
    /// Note that all the setters affecting `r#type` are mutually
    /// exclusive.
    pub fn set_type<T: std::convert::Into<std::option::Option<crate::model::membership::Type>>>(
        mut self,
        v: T,
    ) -> Self {
        self.r#type = v.into();
        self
    }

    /// The value of [r#type][crate::model::Membership::r#type]
    /// if it holds a `Endpoint`, `None` if the field is not set or
    /// holds a different branch.
    pub fn endpoint(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::MembershipEndpoint>> {
        #[allow(unreachable_patterns)]
        self.r#type.as_ref().and_then(|v| match v {
            crate::model::membership::Type::Endpoint(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [r#type][crate::model::Membership::r#type]
    /// to hold a `Endpoint`.
    ///
    /// Note that all the setters affecting `r#type` are
    /// mutually exclusive.
    pub fn set_endpoint<
        T: std::convert::Into<std::boxed::Box<crate::model::MembershipEndpoint>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.r#type = std::option::Option::Some(crate::model::membership::Type::Endpoint(v.into()));
        self
    }
}

impl wkt::message::Message for Membership {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.Membership"
    }
}

/// Defines additional types related to [Membership].
pub mod membership {
    #[allow(unused_imports)]
    use super::*;

    /// Type of resource represented by this Membership
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Type {
        /// Optional. Endpoint information to reach this member.
        Endpoint(std::boxed::Box<crate::model::MembershipEndpoint>),
    }
}

/// MembershipEndpoint contains information needed to contact a Kubernetes API,
/// endpoint and any additional Kubernetes metadata.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MembershipEndpoint {
    /// Optional. GKE-specific information. Only present if this Membership is a GKE cluster.
    pub gke_cluster: std::option::Option<crate::model::GkeCluster>,

    /// Output only. Useful Kubernetes-specific metadata.
    pub kubernetes_metadata: std::option::Option<crate::model::KubernetesMetadata>,

    /// Optional. The in-cluster Kubernetes Resources that should be applied for a
    /// correctly registered cluster, in the steady state. These resources:
    ///
    /// * Ensure that the cluster is exclusively registered to one and only one
    ///   Hub Membership.
    /// * Propagate Workload Pool Information available in the Membership
    ///   Authority field.
    /// * Ensure proper initial configuration of default Hub Features.
    pub kubernetes_resource: std::option::Option<crate::model::KubernetesResource>,

    /// Output only. Whether the lifecycle of this membership is managed by a
    /// google cluster platform service.
    pub google_managed: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl MembershipEndpoint {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [gke_cluster][crate::model::MembershipEndpoint::gke_cluster].
    pub fn set_gke_cluster<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::GkeCluster>,
    {
        self.gke_cluster = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [gke_cluster][crate::model::MembershipEndpoint::gke_cluster].
    pub fn set_or_clear_gke_cluster<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::GkeCluster>,
    {
        self.gke_cluster = v.map(|x| x.into());
        self
    }

    /// Sets the value of [kubernetes_metadata][crate::model::MembershipEndpoint::kubernetes_metadata].
    pub fn set_kubernetes_metadata<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::KubernetesMetadata>,
    {
        self.kubernetes_metadata = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [kubernetes_metadata][crate::model::MembershipEndpoint::kubernetes_metadata].
    pub fn set_or_clear_kubernetes_metadata<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::KubernetesMetadata>,
    {
        self.kubernetes_metadata = v.map(|x| x.into());
        self
    }

    /// Sets the value of [kubernetes_resource][crate::model::MembershipEndpoint::kubernetes_resource].
    pub fn set_kubernetes_resource<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::KubernetesResource>,
    {
        self.kubernetes_resource = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [kubernetes_resource][crate::model::MembershipEndpoint::kubernetes_resource].
    pub fn set_or_clear_kubernetes_resource<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::KubernetesResource>,
    {
        self.kubernetes_resource = v.map(|x| x.into());
        self
    }

    /// Sets the value of [google_managed][crate::model::MembershipEndpoint::google_managed].
    pub fn set_google_managed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.google_managed = v.into();
        self
    }
}

impl wkt::message::Message for MembershipEndpoint {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.MembershipEndpoint"
    }
}

/// KubernetesResource contains the YAML manifests and configuration for
/// Membership Kubernetes resources in the cluster. After CreateMembership or
/// UpdateMembership, these resources should be re-applied in the cluster.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct KubernetesResource {
    /// Input only. The YAML representation of the Membership CR. This field is
    /// ignored for GKE clusters where Hub can read the CR directly.
    ///
    /// Callers should provide the CR that is currently present in the cluster
    /// during CreateMembership or UpdateMembership, or leave this field empty if
    /// none exists. The CR manifest is used to validate the cluster has not been
    /// registered with another Membership.
    pub membership_cr_manifest: std::string::String,

    /// Output only. Additional Kubernetes resources that need to be applied to the
    /// cluster after Membership creation, and after every update.
    ///
    /// This field is only populated in the Membership returned from a successful
    /// long-running operation from CreateMembership or UpdateMembership. It is not
    /// populated during normal GetMembership or ListMemberships requests. To get
    /// the resource manifest after the initial registration, the caller should
    /// make a UpdateMembership call with an empty field mask.
    pub membership_resources: std::vec::Vec<crate::model::ResourceManifest>,

    /// Output only. The Kubernetes resources for installing the GKE Connect agent
    ///
    /// This field is only populated in the Membership returned from a successful
    /// long-running operation from CreateMembership or UpdateMembership. It is not
    /// populated during normal GetMembership or ListMemberships requests. To get
    /// the resource manifest after the initial registration, the caller should
    /// make a UpdateMembership call with an empty field mask.
    pub connect_resources: std::vec::Vec<crate::model::ResourceManifest>,

    /// Optional. Options for Kubernetes resource generation.
    pub resource_options: std::option::Option<crate::model::ResourceOptions>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl KubernetesResource {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [membership_cr_manifest][crate::model::KubernetesResource::membership_cr_manifest].
    pub fn set_membership_cr_manifest<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.membership_cr_manifest = v.into();
        self
    }

    /// Sets the value of [membership_resources][crate::model::KubernetesResource::membership_resources].
    pub fn set_membership_resources<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::ResourceManifest>,
    {
        use std::iter::Iterator;
        self.membership_resources = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [connect_resources][crate::model::KubernetesResource::connect_resources].
    pub fn set_connect_resources<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::ResourceManifest>,
    {
        use std::iter::Iterator;
        self.connect_resources = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [resource_options][crate::model::KubernetesResource::resource_options].
    pub fn set_resource_options<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ResourceOptions>,
    {
        self.resource_options = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [resource_options][crate::model::KubernetesResource::resource_options].
    pub fn set_or_clear_resource_options<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ResourceOptions>,
    {
        self.resource_options = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for KubernetesResource {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.KubernetesResource"
    }
}

/// ResourceOptions represent options for Kubernetes resource generation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResourceOptions {
    /// Optional. The Connect agent version to use for connect_resources. Defaults
    /// to the latest GKE Connect version. The version must be a currently
    /// supported version, obsolete versions will be rejected.
    pub connect_version: std::string::String,

    /// Optional. Use `apiextensions/v1beta1` instead of `apiextensions/v1` for
    /// CustomResourceDefinition resources.
    /// This option should be set for clusters with Kubernetes apiserver versions
    /// <1.16.
    pub v1beta1_crd: bool,

    /// Optional. Major and minor version of the Kubernetes cluster. This is only
    /// used to determine which version to use for the CustomResourceDefinition
    /// resources, `apiextensions/v1beta1` or`apiextensions/v1`.
    pub k8s_version: std::string::String,

    /// Optional. Git version of the Kubernetes cluster. This is only used to gate
    /// the Connect Agent migration to svc.id.goog on GDC-SO 1.33.100 patch and
    /// above.
    pub k8s_git_version: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ResourceOptions {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [connect_version][crate::model::ResourceOptions::connect_version].
    pub fn set_connect_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.connect_version = v.into();
        self
    }

    /// Sets the value of [v1beta1_crd][crate::model::ResourceOptions::v1beta1_crd].
    pub fn set_v1beta1_crd<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.v1beta1_crd = v.into();
        self
    }

    /// Sets the value of [k8s_version][crate::model::ResourceOptions::k8s_version].
    pub fn set_k8s_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.k8s_version = v.into();
        self
    }

    /// Sets the value of [k8s_git_version][crate::model::ResourceOptions::k8s_git_version].
    pub fn set_k8s_git_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.k8s_git_version = v.into();
        self
    }
}

impl wkt::message::Message for ResourceOptions {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.ResourceOptions"
    }
}

/// ResourceManifest represents a single Kubernetes resource to be applied to
/// the cluster.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResourceManifest {
    /// YAML manifest of the resource.
    pub manifest: std::string::String,

    /// Whether the resource provided in the manifest is `cluster_scoped`.
    /// If unset, the manifest is assumed to be namespace scoped.
    ///
    /// This field is used for REST mapping when applying the resource in a
    /// cluster.
    pub cluster_scoped: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ResourceManifest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [manifest][crate::model::ResourceManifest::manifest].
    pub fn set_manifest<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.manifest = v.into();
        self
    }

    /// Sets the value of [cluster_scoped][crate::model::ResourceManifest::cluster_scoped].
    pub fn set_cluster_scoped<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.cluster_scoped = v.into();
        self
    }
}

impl wkt::message::Message for ResourceManifest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.ResourceManifest"
    }
}

/// GkeCluster contains information specific to GKE clusters.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GkeCluster {
    /// Immutable. Self-link of the Google Cloud resource for the GKE cluster. For
    /// example:
    ///
    /// //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
    ///
    /// Zonal clusters are also supported.
    pub resource_link: std::string::String,

    /// Output only. If cluster_missing is set then it denotes that the GKE cluster
    /// no longer exists in the GKE Control Plane.
    pub cluster_missing: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GkeCluster {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [resource_link][crate::model::GkeCluster::resource_link].
    pub fn set_resource_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.resource_link = v.into();
        self
    }

    /// Sets the value of [cluster_missing][crate::model::GkeCluster::cluster_missing].
    pub fn set_cluster_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.cluster_missing = v.into();
        self
    }
}

impl wkt::message::Message for GkeCluster {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.GkeCluster"
    }
}

/// KubernetesMetadata provides informational metadata for Memberships
/// representing Kubernetes clusters.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct KubernetesMetadata {
    /// Output only. Kubernetes API server version string as reported by
    /// `/version`.
    pub kubernetes_api_server_version: std::string::String,

    /// Output only. Node providerID as reported by the first node in the list of
    /// nodes on the Kubernetes endpoint. On Kubernetes platforms that support
    /// zero-node clusters (like GKE-on-GCP), the node_count will be zero and the
    /// node_provider_id will be empty.
    pub node_provider_id: std::string::String,

    /// Output only. Node count as reported by Kubernetes nodes resources.
    pub node_count: i32,

    /// Output only. vCPU count as reported by Kubernetes nodes resources.
    pub vcpu_count: i32,

    /// Output only. The total memory capacity as reported by the sum of all
    /// Kubernetes nodes resources, defined in MB.
    pub memory_mb: i32,

    /// Output only. The time at which these details were last updated. This
    /// update_time is different from the Membership-level update_time since
    /// EndpointDetails are updated internally for API consumers.
    pub update_time: std::option::Option<wkt::Timestamp>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl KubernetesMetadata {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [kubernetes_api_server_version][crate::model::KubernetesMetadata::kubernetes_api_server_version].
    pub fn set_kubernetes_api_server_version<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.kubernetes_api_server_version = v.into();
        self
    }

    /// Sets the value of [node_provider_id][crate::model::KubernetesMetadata::node_provider_id].
    pub fn set_node_provider_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.node_provider_id = v.into();
        self
    }

    /// Sets the value of [node_count][crate::model::KubernetesMetadata::node_count].
    pub fn set_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.node_count = v.into();
        self
    }

    /// Sets the value of [vcpu_count][crate::model::KubernetesMetadata::vcpu_count].
    pub fn set_vcpu_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.vcpu_count = v.into();
        self
    }

    /// Sets the value of [memory_mb][crate::model::KubernetesMetadata::memory_mb].
    pub fn set_memory_mb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.memory_mb = v.into();
        self
    }

    /// Sets the value of [update_time][crate::model::KubernetesMetadata::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::KubernetesMetadata::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for KubernetesMetadata {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.KubernetesMetadata"
    }
}

/// This field informs Fleet-based applications/services/UIs with the necessary
/// information for where each underlying Cluster reports its metrics.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MonitoringConfig {
    /// Immutable. Project used to report Metrics
    pub project_id: std::string::String,

    /// Immutable. Location used to report Metrics
    pub location: std::string::String,

    /// Immutable. Cluster name used to report metrics.
    /// For Anthos on VMWare/Baremetal, it would be in format
    /// `memberClusters/cluster_name`; And for Anthos on MultiCloud, it would be in
    /// format
    /// `{azureClusters, awsClusters}/cluster_name`.
    pub cluster: std::string::String,

    /// Kubernetes system metrics, if available, are written to this prefix.
    /// This defaults to kubernetes.io for GKE, and kubernetes.io/anthos for Anthos
    /// eventually. Noted: Anthos MultiCloud will have kubernetes.io prefix today
    /// but will migration to be under kubernetes.io/anthos
    pub kubernetes_metrics_prefix: std::string::String,

    /// Immutable. Cluster hash, this is a unique string generated by google code,
    /// which does not contain any PII, which we can use to reference the cluster.
    /// This is expected to be created by the monitoring stack and persisted into
    /// the Cluster object as well as to GKE-Hub.
    pub cluster_hash: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl MonitoringConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [project_id][crate::model::MonitoringConfig::project_id].
    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.project_id = v.into();
        self
    }

    /// Sets the value of [location][crate::model::MonitoringConfig::location].
    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.location = v.into();
        self
    }

    /// Sets the value of [cluster][crate::model::MonitoringConfig::cluster].
    pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.cluster = v.into();
        self
    }

    /// Sets the value of [kubernetes_metrics_prefix][crate::model::MonitoringConfig::kubernetes_metrics_prefix].
    pub fn set_kubernetes_metrics_prefix<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.kubernetes_metrics_prefix = v.into();
        self
    }

    /// Sets the value of [cluster_hash][crate::model::MonitoringConfig::cluster_hash].
    pub fn set_cluster_hash<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.cluster_hash = v.into();
        self
    }
}

impl wkt::message::Message for MonitoringConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.MonitoringConfig"
    }
}

/// MembershipState describes the state of a Membership resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MembershipState {
    /// Output only. The current state of the Membership resource.
    pub code: crate::model::membership_state::Code,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl MembershipState {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [code][crate::model::MembershipState::code].
    pub fn set_code<T: std::convert::Into<crate::model::membership_state::Code>>(
        mut self,
        v: T,
    ) -> Self {
        self.code = v.into();
        self
    }
}

impl wkt::message::Message for MembershipState {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.MembershipState"
    }
}

/// Defines additional types related to [MembershipState].
pub mod membership_state {
    #[allow(unused_imports)]
    use super::*;

    /// Code describes the state of a Membership resource.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Code {
        /// The code is not set.
        Unspecified,
        /// The cluster is being registered.
        Creating,
        /// The cluster is registered.
        Ready,
        /// The cluster is being unregistered.
        Deleting,
        /// The Membership is being updated.
        Updating,
        /// The Membership is being updated by the Hub Service.
        ServiceUpdating,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [Code::value] or
        /// [Code::name].
        UnknownValue(code::UnknownValue),
    }

    #[doc(hidden)]
    pub mod code {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl Code {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Creating => std::option::Option::Some(1),
                Self::Ready => std::option::Option::Some(2),
                Self::Deleting => std::option::Option::Some(3),
                Self::Updating => std::option::Option::Some(4),
                Self::ServiceUpdating => std::option::Option::Some(5),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
                Self::Creating => std::option::Option::Some("CREATING"),
                Self::Ready => std::option::Option::Some("READY"),
                Self::Deleting => std::option::Option::Some("DELETING"),
                Self::Updating => std::option::Option::Some("UPDATING"),
                Self::ServiceUpdating => std::option::Option::Some("SERVICE_UPDATING"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for Code {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for Code {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for Code {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Creating,
                2 => Self::Ready,
                3 => Self::Deleting,
                4 => Self::Updating,
                5 => Self::ServiceUpdating,
                _ => Self::UnknownValue(code::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for Code {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "CODE_UNSPECIFIED" => Self::Unspecified,
                "CREATING" => Self::Creating,
                "READY" => Self::Ready,
                "DELETING" => Self::Deleting,
                "UPDATING" => Self::Updating,
                "SERVICE_UPDATING" => Self::ServiceUpdating,
                _ => Self::UnknownValue(code::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for Code {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Creating => serializer.serialize_i32(1),
                Self::Ready => serializer.serialize_i32(2),
                Self::Deleting => serializer.serialize_i32(3),
                Self::Updating => serializer.serialize_i32(4),
                Self::ServiceUpdating => serializer.serialize_i32(5),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for Code {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
                ".google.cloud.gkehub.v1.MembershipState.Code",
            ))
        }
    }
}

/// Authority encodes how Google will recognize identities from this Membership.
/// See the workload identity documentation for more details:
/// <https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity>
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Authority {
    /// Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start with
    /// `https://` and be a valid URL with length <2000 characters.
    ///
    /// If set, then Google will allow valid OIDC tokens from this issuer to
    /// authenticate within the workload_identity_pool. OIDC discovery will be
    /// performed on this URI to validate tokens from the issuer.
    ///
    /// Clearing `issuer` disables Workload Identity. `issuer` cannot be directly
    /// modified; it must be cleared (and Workload Identity disabled) before using
    /// a new issuer (and re-enabling Workload Identity).
    pub issuer: std::string::String,

    /// Output only. The name of the workload identity pool in which `issuer` will
    /// be recognized.
    ///
    /// There is a single Workload Identity Pool per Hub that is shared
    /// between all Memberships that belong to that Hub. For a Hub hosted in
    /// {PROJECT_ID}, the workload pool format is `{PROJECT_ID}.hub.id.goog`,
    /// although this is subject to change in newer versions of this API.
    pub workload_identity_pool: std::string::String,

    /// Output only. An identity provider that reflects the `issuer` in the
    /// workload identity pool.
    pub identity_provider: std::string::String,

    /// Optional. OIDC verification keys for this Membership in JWKS format (RFC
    /// 7517).
    ///
    /// When this field is set, OIDC discovery will NOT be performed on `issuer`,
    /// and instead OIDC tokens will be validated using this field.
    pub oidc_jwks: ::bytes::Bytes,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Authority {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [issuer][crate::model::Authority::issuer].
    pub fn set_issuer<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.issuer = v.into();
        self
    }

    /// Sets the value of [workload_identity_pool][crate::model::Authority::workload_identity_pool].
    pub fn set_workload_identity_pool<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.workload_identity_pool = v.into();
        self
    }

    /// Sets the value of [identity_provider][crate::model::Authority::identity_provider].
    pub fn set_identity_provider<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.identity_provider = v.into();
        self
    }

    /// Sets the value of [oidc_jwks][crate::model::Authority::oidc_jwks].
    pub fn set_oidc_jwks<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
        self.oidc_jwks = v.into();
        self
    }
}

impl wkt::message::Message for Authority {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.Authority"
    }
}

/// Request message for `GkeHub.ListMemberships` method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMembershipsRequest {
    /// Required. The parent (project and location) where the Memberships will be
    /// listed. Specified in the format `projects/*/locations/*`.
    /// `projects/*/locations/-` list memberships in all the regions.
    pub parent: std::string::String,

    /// Optional. When requesting a 'page' of resources, `page_size` specifies
    /// number of resources to return. If unspecified or set to 0, all resources
    /// will be returned.
    pub page_size: i32,

    /// Optional. Token returned by previous call to `ListMemberships` which
    /// specifies the position in the list from where to continue listing the
    /// resources.
    pub page_token: std::string::String,

    /// Optional. Lists Memberships that match the filter expression, following the
    /// syntax outlined in <https://google.aip.dev/160>.
    ///
    /// Examples:
    ///
    /// - Name is `bar` in project `foo-proj` and location `global`:
    ///
    ///   name = "projects/foo-proj/locations/global/membership/bar"
    ///
    /// - Memberships that have a label called `foo`:
    ///
    ///   labels.foo:*
    ///
    /// - Memberships that have a label called `foo` whose value is `bar`:
    ///
    ///   labels.foo = bar
    ///
    /// - Memberships in the CREATING state:
    ///
    ///   state = CREATING
    ///
    pub filter: std::string::String,

    /// Optional. One or more fields to compare and use to sort the output.
    /// See <https://google.aip.dev/132#ordering>.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListMembershipsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListMembershipsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListMembershipsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListMembershipsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListMembershipsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListMembershipsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListMembershipsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.ListMembershipsRequest"
    }
}

/// Response message for the `GkeHub.ListMemberships` method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMembershipsResponse {
    /// The list of matching Memberships.
    pub resources: std::vec::Vec<crate::model::Membership>,

    /// A token to request the next page of resources from the
    /// `ListMemberships` method. The value of an empty string means that
    /// there are no more resources to return.
    pub next_page_token: std::string::String,

    /// List of locations that could not be reached while fetching this list.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListMembershipsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [resources][crate::model::ListMembershipsResponse::resources].
    pub fn set_resources<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Membership>,
    {
        use std::iter::Iterator;
        self.resources = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListMembershipsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListMembershipsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListMembershipsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.ListMembershipsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListMembershipsResponse {
    type PageItem = crate::model::Membership;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.resources
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request message for `GkeHub.GetMembership` method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetMembershipRequest {
    /// Required. The Membership resource name in the format
    /// `projects/*/locations/*/memberships/*`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetMembershipRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetMembershipRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetMembershipRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.GetMembershipRequest"
    }
}

/// Request message for the `GkeHub.CreateMembership` method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateMembershipRequest {
    /// Required. The parent (project and location) where the Memberships will be
    /// created. Specified in the format `projects/*/locations/*`.
    pub parent: std::string::String,

    /// Required. Client chosen ID for the membership. `membership_id` must be a
    /// valid RFC 1123 compliant DNS label:
    ///
    /// 1. At most 63 characters in length
    /// 1. It must consist of lower case alphanumeric characters or `-`
    /// 1. It must start and end with an alphanumeric character
    ///
    /// Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`,
    /// with a maximum length of 63 characters.
    pub membership_id: std::string::String,

    /// Required. The membership to create.
    pub resource: std::option::Option<crate::model::Membership>,

    /// Optional. A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server will know to ignore
    /// the request if it has already been completed. The server will guarantee
    /// that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateMembershipRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateMembershipRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [membership_id][crate::model::CreateMembershipRequest::membership_id].
    pub fn set_membership_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.membership_id = v.into();
        self
    }

    /// Sets the value of [resource][crate::model::CreateMembershipRequest::resource].
    pub fn set_resource<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Membership>,
    {
        self.resource = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [resource][crate::model::CreateMembershipRequest::resource].
    pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Membership>,
    {
        self.resource = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateMembershipRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateMembershipRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.CreateMembershipRequest"
    }
}

/// Request message for `GkeHub.DeleteMembership` method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteMembershipRequest {
    /// Required. The Membership resource name in the format
    /// `projects/*/locations/*/memberships/*`.
    pub name: std::string::String,

    /// Optional. A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server will know to ignore
    /// the request if it has already been completed. The server will guarantee
    /// that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    /// Optional. If set to true, any subresource from this Membership will also be
    /// deleted. Otherwise, the request will only work if the Membership has no
    /// subresource.
    pub force: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteMembershipRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteMembershipRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteMembershipRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }

    /// Sets the value of [force][crate::model::DeleteMembershipRequest::force].
    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.force = v.into();
        self
    }
}

impl wkt::message::Message for DeleteMembershipRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.DeleteMembershipRequest"
    }
}

/// Request message for `GkeHub.UpdateMembership` method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateMembershipRequest {
    /// Required. The Membership resource name in the format
    /// `projects/*/locations/*/memberships/*`.
    pub name: std::string::String,

    /// Required. Mask of fields to update.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. Only fields specified in update_mask are updated.
    /// If you specify a field in the update_mask but don't specify its value here
    /// that field will be deleted.
    /// If you are updating a map field, set the value of a key to null or empty
    /// string to delete the key from the map. It's not possible to update a key's
    /// value to the empty string.
    /// If you specify the update_mask to be a special path "*", fully replaces all
    /// user-modifiable fields to match `resource`.
    pub resource: std::option::Option<crate::model::Membership>,

    /// Optional. A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server will know to ignore
    /// the request if it has already been completed. The server will guarantee
    /// that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateMembershipRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::UpdateMembershipRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdateMembershipRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateMembershipRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [resource][crate::model::UpdateMembershipRequest::resource].
    pub fn set_resource<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Membership>,
    {
        self.resource = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [resource][crate::model::UpdateMembershipRequest::resource].
    pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Membership>,
    {
        self.resource = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateMembershipRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateMembershipRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.UpdateMembershipRequest"
    }
}

/// Request message for `GkeHub.GenerateConnectManifest`
/// method.
/// .
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GenerateConnectManifestRequest {
    /// Required. The Membership resource name the Agent will associate with, in
    /// the format `projects/*/locations/*/memberships/*`.
    pub name: std::string::String,

    /// Optional. Namespace for GKE Connect agent resources. Defaults to
    /// `gke-connect`.
    ///
    /// The Connect Agent is authorized automatically when run in the default
    /// namespace. Otherwise, explicit authorization must be granted with an
    /// additional IAM binding.
    pub namespace: std::string::String,

    /// Optional. URI of a proxy if connectivity from the agent to
    /// gkeconnect.googleapis.com requires the use of a proxy. Format must be in
    /// the form `http(s)://{proxy_address}`, depending on the HTTP/HTTPS protocol
    /// supported by the proxy. This will direct the connect agent's outbound
    /// traffic through a HTTP(S) proxy.
    pub proxy: ::bytes::Bytes,

    /// Optional. The Connect agent version to use. Defaults to the most current
    /// version.
    pub version: std::string::String,

    /// Optional. If true, generate the resources for upgrade only. Some resources
    /// generated only for installation (e.g. secrets) will be excluded.
    pub is_upgrade: bool,

    /// Optional. The registry to fetch the connect agent image from. Defaults to
    /// gcr.io/gkeconnect.
    pub registry: std::string::String,

    /// Optional. The image pull secret content for the registry, if not public.
    pub image_pull_secret_content: ::bytes::Bytes,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GenerateConnectManifestRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GenerateConnectManifestRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [namespace][crate::model::GenerateConnectManifestRequest::namespace].
    pub fn set_namespace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.namespace = v.into();
        self
    }

    /// Sets the value of [proxy][crate::model::GenerateConnectManifestRequest::proxy].
    pub fn set_proxy<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
        self.proxy = v.into();
        self
    }

    /// Sets the value of [version][crate::model::GenerateConnectManifestRequest::version].
    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.version = v.into();
        self
    }

    /// Sets the value of [is_upgrade][crate::model::GenerateConnectManifestRequest::is_upgrade].
    pub fn set_is_upgrade<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.is_upgrade = v.into();
        self
    }

    /// Sets the value of [registry][crate::model::GenerateConnectManifestRequest::registry].
    pub fn set_registry<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.registry = v.into();
        self
    }

    /// Sets the value of [image_pull_secret_content][crate::model::GenerateConnectManifestRequest::image_pull_secret_content].
    pub fn set_image_pull_secret_content<T: std::convert::Into<::bytes::Bytes>>(
        mut self,
        v: T,
    ) -> Self {
        self.image_pull_secret_content = v.into();
        self
    }
}

impl wkt::message::Message for GenerateConnectManifestRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.GenerateConnectManifestRequest"
    }
}

/// GenerateConnectManifestResponse contains manifest information for
/// installing/upgrading a Connect agent.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GenerateConnectManifestResponse {
    /// The ordered list of Kubernetes resources that need to be applied to the
    /// cluster for GKE Connect agent installation/upgrade.
    pub manifest: std::vec::Vec<crate::model::ConnectAgentResource>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GenerateConnectManifestResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [manifest][crate::model::GenerateConnectManifestResponse::manifest].
    pub fn set_manifest<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::ConnectAgentResource>,
    {
        use std::iter::Iterator;
        self.manifest = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for GenerateConnectManifestResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.GenerateConnectManifestResponse"
    }
}

/// ConnectAgentResource represents a Kubernetes resource manifest for Connect
/// Agent deployment.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConnectAgentResource {
    /// Kubernetes type of the resource.
    pub r#type: std::option::Option<crate::model::TypeMeta>,

    /// YAML manifest of the resource.
    pub manifest: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ConnectAgentResource {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [r#type][crate::model::ConnectAgentResource::type].
    pub fn set_type<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::TypeMeta>,
    {
        self.r#type = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [r#type][crate::model::ConnectAgentResource::type].
    pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::TypeMeta>,
    {
        self.r#type = v.map(|x| x.into());
        self
    }

    /// Sets the value of [manifest][crate::model::ConnectAgentResource::manifest].
    pub fn set_manifest<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.manifest = v.into();
        self
    }
}

impl wkt::message::Message for ConnectAgentResource {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.ConnectAgentResource"
    }
}

/// TypeMeta is the type information needed for content unmarshalling of
/// Kubernetes resources in the manifest.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TypeMeta {
    /// Kind of the resource (e.g. Deployment).
    pub kind: std::string::String,

    /// APIVersion of the resource (e.g. v1).
    pub api_version: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl TypeMeta {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [kind][crate::model::TypeMeta::kind].
    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.kind = v.into();
        self
    }

    /// Sets the value of [api_version][crate::model::TypeMeta::api_version].
    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.api_version = v.into();
        self
    }
}

impl wkt::message::Message for TypeMeta {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.TypeMeta"
    }
}

/// Request message for `GkeHub.ListFeatures` method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListFeaturesRequest {
    /// Required. The parent (project and location) where the Features will be
    /// listed. Specified in the format `projects/*/locations/*`.
    pub parent: std::string::String,

    /// When requesting a 'page' of resources, `page_size` specifies number of
    /// resources to return. If unspecified or set to 0, all resources will
    /// be returned.
    pub page_size: i32,

    /// Token returned by previous call to `ListFeatures` which
    /// specifies the position in the list from where to continue listing the
    /// resources.
    pub page_token: std::string::String,

    /// Lists Features that match the filter expression, following the syntax
    /// outlined in <https://google.aip.dev/160>.
    ///
    /// Examples:
    ///
    /// - Feature with the name "servicemesh" in project "foo-proj":
    ///
    ///   name = "projects/foo-proj/locations/global/features/servicemesh"
    ///
    /// - Features that have a label called `foo`:
    ///
    ///   labels.foo:*
    ///
    /// - Features that have a label called `foo` whose value is `bar`:
    ///
    ///   labels.foo = bar
    ///
    pub filter: std::string::String,

    /// One or more fields to compare and use to sort the output.
    /// See <https://google.aip.dev/132#ordering>.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListFeaturesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListFeaturesRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListFeaturesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListFeaturesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListFeaturesRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListFeaturesRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListFeaturesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.ListFeaturesRequest"
    }
}

/// Response message for the `GkeHub.ListFeatures` method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListFeaturesResponse {
    /// The list of matching Features
    pub resources: std::vec::Vec<crate::model::Feature>,

    /// A token to request the next page of resources from the
    /// `ListFeatures` method. The value of an empty string means
    /// that there are no more resources to return.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListFeaturesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [resources][crate::model::ListFeaturesResponse::resources].
    pub fn set_resources<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Feature>,
    {
        use std::iter::Iterator;
        self.resources = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListFeaturesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListFeaturesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.ListFeaturesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListFeaturesResponse {
    type PageItem = crate::model::Feature;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.resources
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request message for `GkeHub.GetFeature` method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetFeatureRequest {
    /// Required. The Feature resource name in the format
    /// `projects/*/locations/*/features/*`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetFeatureRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetFeatureRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetFeatureRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.GetFeatureRequest"
    }
}

/// Request message for the `GkeHub.CreateFeature` method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateFeatureRequest {
    /// Required. The parent (project and location) where the Feature will be
    /// created. Specified in the format `projects/*/locations/*`.
    pub parent: std::string::String,

    /// The ID of the feature to create.
    pub feature_id: std::string::String,

    /// The Feature resource to create.
    pub resource: std::option::Option<crate::model::Feature>,

    /// Optional. A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server will know to ignore
    /// the request if it has already been completed. The server will guarantee
    /// that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateFeatureRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateFeatureRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [feature_id][crate::model::CreateFeatureRequest::feature_id].
    pub fn set_feature_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.feature_id = v.into();
        self
    }

    /// Sets the value of [resource][crate::model::CreateFeatureRequest::resource].
    pub fn set_resource<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Feature>,
    {
        self.resource = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [resource][crate::model::CreateFeatureRequest::resource].
    pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Feature>,
    {
        self.resource = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateFeatureRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateFeatureRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.CreateFeatureRequest"
    }
}

/// Request message for `GkeHub.DeleteFeature` method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteFeatureRequest {
    /// Required. The Feature resource name in the format
    /// `projects/*/locations/*/features/*`.
    pub name: std::string::String,

    /// If set to true, the delete will ignore any outstanding resources for
    /// this Feature (that is, `FeatureState.has_resources` is set to true). These
    /// resources will NOT be cleaned up or modified in any way.
    pub force: bool,

    /// Optional. A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server will know to ignore
    /// the request if it has already been completed. The server will guarantee
    /// that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteFeatureRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteFeatureRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [force][crate::model::DeleteFeatureRequest::force].
    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.force = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteFeatureRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteFeatureRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.DeleteFeatureRequest"
    }
}

/// Request message for `GkeHub.UpdateFeature` method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateFeatureRequest {
    /// Required. The Feature resource name in the format
    /// `projects/*/locations/*/features/*`.
    pub name: std::string::String,

    /// Mask of fields to update.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Only fields specified in update_mask are updated.
    /// If you specify a field in the update_mask but don't specify its value here
    /// that field will be deleted.
    /// If you are updating a map field, set the value of a key to null or empty
    /// string to delete the key from the map. It's not possible to update a key's
    /// value to the empty string.
    /// If you specify the update_mask to be a special path "*", fully replaces all
    /// user-modifiable fields to match `resource`.
    pub resource: std::option::Option<crate::model::Feature>,

    /// Optional. A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server will know to ignore
    /// the request if it has already been completed. The server will guarantee
    /// that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateFeatureRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::UpdateFeatureRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdateFeatureRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateFeatureRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [resource][crate::model::UpdateFeatureRequest::resource].
    pub fn set_resource<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Feature>,
    {
        self.resource = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [resource][crate::model::UpdateFeatureRequest::resource].
    pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Feature>,
    {
        self.resource = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateFeatureRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateFeatureRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.UpdateFeatureRequest"
    }
}

/// Represents the metadata of the long-running operation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationMetadata {
    /// Output only. The time the operation was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time the operation finished running.
    pub end_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Server-defined resource path for the target of the operation.
    pub target: std::string::String,

    /// Output only. Name of the verb executed by the operation.
    pub verb: std::string::String,

    /// Output only. Human-readable status of the operation, if any.
    pub status_detail: std::string::String,

    /// Output only. Identifies whether the user has requested cancellation
    /// of the operation. Operations that have successfully been cancelled
    /// have [Operation.error][] value with a
    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
    /// `Code.CANCELLED`.
    ///
    /// [google.rpc.Status.code]: rpc::model::Status::code
    pub cancel_requested: bool,

    /// Output only. API version used to start the operation.
    pub api_version: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl OperationMetadata {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
    pub fn set_end_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [target][crate::model::OperationMetadata::target].
    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.target = v.into();
        self
    }

    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.verb = v.into();
        self
    }

    /// Sets the value of [status_detail][crate::model::OperationMetadata::status_detail].
    pub fn set_status_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.status_detail = v.into();
        self
    }

    /// Sets the value of [cancel_requested][crate::model::OperationMetadata::cancel_requested].
    pub fn set_cancel_requested<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.cancel_requested = v.into();
        self
    }

    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.api_version = v.into();
        self
    }
}

impl wkt::message::Message for OperationMetadata {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.gkehub.v1.OperationMetadata"
    }
}
